package mi.payment.constants;

import java.util.HashMap;
import java.util.Map;

import mi.payment.MyApplication;
import mi.payment.R;

/**
 * @author Created by Administrator on 2016/6/20.
 */
public class TransTypeSettlement {

    private static final Map transTypes = new HashMap<String, String>();

    public static String getName(String code) {
        if (transTypes.isEmpty()) {
            initMap();
        }
        if (transTypes.containsKey(code)) {
            return (String) transTypes.get(code);
        } else {
            return code;
        }
    }

    private static void initMap() {
        transTypes.put("00", getString(R.string.transtypes00));
        transTypes.put("01", getString(R.string.transtypes01));
        transTypes.put("03", getString(R.string.transtypes03));
        transTypes.put("10", getString(R.string.transtypes10));
        transTypes.put("11", getString(R.string.transtypes11));
        transTypes.put("20", getString(R.string.transtypes20));
        transTypes.put("21", getString(R.string.transtypes21));
        transTypes.put("22", getString(R.string.transtypes22));
        transTypes.put("23", getString(R.string.transtypes23));
        transTypes.put("24", getString(R.string.transtypes24));
        transTypes.put("25", getString(R.string.transtypes25));
        transTypes.put("27", getString(R.string.transtypes27));
        transTypes.put("30", getString(R.string.transtypes30));
        transTypes.put("32", getString(R.string.transtypes32));
        transTypes.put("34", getString(R.string.transtypes34));
        transTypes.put("36", getString(R.string.transtypes36));
        transTypes.put("40", getString(R.string.transtypes40));
        transTypes.put("41", getString(R.string.transtypes41));
        transTypes.put("42", getString(R.string.transtypes42));
        transTypes.put("45", getString(R.string.transtypes45));
        transTypes.put("46", getString(R.string.transtypes46));
        transTypes.put("47", getString(R.string.transtypes47));
        transTypes.put("48", getString(R.string.transtypes48));
        transTypes.put("49", getString(R.string.transtypes49));
        transTypes.put("51", getString(R.string.transtypes51));
        transTypes.put("53", getString(R.string.transtypes53));
        transTypes.put("54", getString(R.string.transtypes54));

        transTypes.put(TransShortType.AL, getString(R.string.transtypesAL));
        transTypes.put(TransShortType.AD, getString(R.string.transtypesAD));
        transTypes.put(TransShortType.AR, getString(R.string.transtypesAR));
        transTypes.put(TransShortType.WX, getString(R.string.transtypesWX));
        transTypes.put(TransShortType.WD, getString(R.string.transtypesWD));
        transTypes.put(TransShortType.WR, getString(R.string.transtypesWR));
        transTypes.put(TransShortType.UX, getString(R.string.transtypesUX));
        transTypes.put(TransShortType.UD, getString(R.string.transtypesUD));
        transTypes.put(TransShortType.UR, getString(R.string.transtypesUR));
    }

    static String getString(int id) {
        return MyApplication.getInstance().getString(id);
    }

}
